package com.lss.study.algorithm.leecode.t0801;

/**
 * 功能描述：
 *
 * @Date: 2022/2/20 18:01
 */
public class Main {
    public static void main(String[] args) {

    }

    class Solution {
        public int waysToStep(int n) {
            if (n <= 2) {
                return n;
            }
            int[] dp = new int[n+1];
            dp[1] = 1;
            dp[2] = 2;
            dp[3] = 4;
            for (int i = 4; i < n+1; i++) {
                dp[i] = (dp[i-1] + dp[i-2] + dp[i-3]) % 1000000007;
            }
            return dp[n];
        }
    }

}
